import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/',
    name: '/',
    component: () => import('../layout'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/home.vue')
      },
      {
        path: 'categories',
        name: 'categories',
        component: () => import('@/views/basics/categories/Company.vue')
      },
      {
        path: 'orders',
        name: 'orders',
        component: () => import('@/views/basics/orders/index.vue')
      },
      {
        path: 'file',
        name: 'file',
        component: () => import('@/views/file/Licenseplate.vue')
      },
      {
        path: 'role',
        name: 'role',
        component: () => import('@/views/system/role/index.vue')
      },
      {
        path: 'permission',
        name: 'permission',
        component: () => import('@/views/system/permission/index.vue')
      },
      {
        path: 'brand',
        name: 'brand',
        component: () => import('@/views/basics/brand/index.vue')
      },
      {
        path: 'model',
        name: 'model',
        component: () => import('@/views/basics/model/index.vue')
      },
      {
        path: 'color',
        name: 'color',
        component: () => import('@/views/basics/color/index.vue')
      },
      {
        path: 'accessoriesType',
        name: 'accessoriesType',
        component: () => import('@/views/accessories/accessoriesType/index.vue')
      },
      {
        path: 'accessories',
        name: 'accessories',
        component: () => import('@/views/accessories/accessories/index.vue')
      },
      {
        path: 'inventory',
        name: 'inventory',
        component: () => import('@/views/accessories/inventory/index.vue')
      },
      {
        path: 'user',
        name: 'user',
        component: () => import('@/views/personnel/users/index.vue')
      },
      {
        path: 'maintain',
        name: 'maintain',
        component: () => import('@/views/basics/maintain/index.vue')
      },
      {
        path: 'repair',
        name: 'repair',
        component: () => import('@/views/basics/repair/index.vue')
      },
      {
        path: 'wages',
        name: 'wages',
        component: () => import('@/views/financial/wages/index.vue')
      },
      {
        path: 'workorder',
        name: 'workorder',
        component: () => import('@/views/personnel/workorder/index.vue')
      },
      {
        path: 'supplyType',
        name: 'supplyType',
        component: () => import('@/views/supplier/supplyType/index.vue')
      },
      {
        path: 'supply',
        name: 'supply',
        component: () => import('@/views/supplier/supply/index.vue')
      },
      {
        path: 'purchaseBill',
        name: 'purchaseBill',
        component: () => import('@/views/supplier/purchaseBill/index.vue')
      },
      {
        path: 'appointment',
        name: 'appointment',
        component: () => import('@/views/Maintenance/appointment/index.vue')
      },
      {
        path: 'progress',
        name: 'progress',
        component: () => import('@/views/Maintenance/progress/index.vue')
      },
      {
        path: 'income',
        name: 'income',
        component: () => import('@/views/financial/income/income.vue')
      },
      {
        path: 'expenditure',
        name: 'expenditure',
        component: () => import('@/views/financial/expenditure/expenditure.vue')
      },
      {
        path: 'material',
        name: 'material',
        component: () => import('@/views/dispatch/material/material.vue')
      },
      {
        path: 'complaint',
        name: 'complaint',
        component: () => import('@/views/customer/complaint/index.vue')
      },
      {
        path: 'picking',
        name: 'picking',
        component: () => import('@/views/dispatch/picking/picking.vue')
      },
      {
        path: 'checkin',
        name: 'checkin',
        component: () => import('@/views/receive/checkin/index.vue')
      },
      {
        path: 'maintainRecord',
        name: 'maintainRecord',
        component: () => import('@/views/receive/maintainRecord/index.vue')
      },
      {
        path: 'closing',
        name: 'closing',
        component: () => import('@/views/cartlifting/closing/index.vue')
      },
      {
        path: 'receipts',
        name: 'receipts',
        component: () => import('@/views/cartlifting/receipts/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
